class MyHashSet(object):

    def __init__(self):
        self.hashSet = [False] * 1000001

    def add(self, key):
        self.hashSet[key] = True

    def remove(self, key):
        self.hashSet[key] = False

    def contains(self, key):
        return self.hashSet[key]


myHashSet = MyHashSet()
myHashSet.add(1)  # set = [1]
myHashSet.add(2)  # set = [1, 2]
print(myHashSet.contains(1))  # 返回 True
print(myHashSet.contains(3))  # 返回 False ，（未找到）
myHashSet.add(2)  # set = [1, 2]
print(myHashSet.contains(2))  # 返回 True
myHashSet.remove(2)  # set = [1]
print(myHashSet.contains(2))  # 返回 False ，（已移除）
